import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      component: () => import("../views/Index.vue"),
      redirect: '/index/shou',
      children: [
        { path: 'shou', component: () => import("../views/Shou/Shou.vue") },
        { path: 'buy', component: () => import("../views/Buy/Buy.vue") },
        { path: 'car', component: () => import("../views/Car/Car.vue") },
        { path: 'sale', component: () => import("../views/Sale/Sale.vue") },
        { path: 'my', component: () => import("../views/My/My.vue") },
      ]
    },
    {
      path: '/kef',
      component: () => import("../views/Kef/Kef.vue")
    },
    {
      path: '/genduo',
      component: () => import("../views/Genduo/Genduo.vue")
    },
    {
      path: "/add",
      component: () => import("../views/Sale/Add.vue")
    },
    {
      path: "/addt",
      component: () => import("../views/Sale/AddTwo.vue")
    },
    {
      path: "/sousuo",
      component: () => import("../views/Shou/Sousuo.vue")
    }
  ]
})

export default router
